<template>
  <div class="container">
    <scroll-view :scroll-y="true" :style="{'height': clientHeight+'px'}" @scrolltolower="load_more"
      v-if="project_result.length>0">
      <project-list :project_list="project_result"></project-list>
      <list-botton v-if="tobottom"></list-botton>
    </scroll-view>
    <empty v-else></empty>
  </div>
</template>
<script>
import projectList from "@/components/search_list/projects_list";
import listBotton from "@/components/search/result_item/bottom";
import empty from "@/components/search/empty";
export default {
  data() {
    return {
      page: 1,
      clientHeight: 0,

    };
  },
  components: {
    projectList,
    listBotton,
    empty
  },
  props: ["project_result", "tobottom"],
  methods: {
    load_more() {
      this.page++;
      this.$emit("loadMore", this.page);
    }
  },
  watch: {
    tobottom(newVal, oldVal) {},
    project_result(newVal, oldVal) {}
  },
  created() {
    let that = this;
    // 获取系统信息
    wx.getSystemInfo({
      success: function(res) {
        // 获取可使用窗口宽度
        let clientHeight = res.windowHeight;
        that.clientHeight = clientHeight - 94
      }
    });
  },
  mounted() {}
};
</script>

<style lang="less" scoped>
.container {
  height: 100%;
}
</style>